package demo;

public class Text {
    public static void test(Animal animal){
        animal.eat();
    }
    public static void test2(IRunning iRunning){
        iRunning.run();
    }
    public static void test3(IFlying iFlying){
        iFlying.fly();
    }
    public static void test4(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void main(String[] args) {
        Brid brid = new Brid("小鸟", 10);
        Dog dog = new Dog("小狗", 12);  //会优先写实例代码块
        //xiaoming
        test(brid);
        test2(brid);
        test3(brid);
        //test4(brid);// 这个接口没有在Brid这个类里实现
        test(dog);
        test2(dog);
        test4(dog);
    }
}
